home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Champak Vol F-12
/
(Vol F-12) Jun 02 2012.iso
/
Screensaver
/
screensaver_installer.exe
/
____swmx
/
scripts
/
frame_1
/
DoAction_2.as
< prev
next >
Wrap
Text File
|
2004-10-21
|
3KB
|
140 lines
_global.ScreenweaverDebug = function()
{
this.init();
};
ScreenweaverDebug.prototype.init = function()
{
this.sync = false;
};
ScreenweaverDebug.prototype.getSync = function()
{
return this.sync;
};
ScreenweaverDebug.prototype.setSync = function(sync)
{
this.sync = sync;
};
ScreenweaverDebug.prototype.syncTrace = function(section, arg, callback, scope)
{
args = {section:section,message:arg};
swInterface.callMethod("syncTrace",args,callback,false,scope);
};
ScreenweaverDebug.prototype.trace = function(arg)
{
if(!this.sync)
{
getURL("FSCommand:sw_utrace",arg);
}
else
{
this.syncTrace("user",arg);
}
};
ScreenweaverDebug.prototype.apiTrace = function(arg)
{
if(!this.sync)
{
getURL("FSCommand:sw_atrace",arg);
}
else
{
this.syncTrace("api",arg);
}
};
ScreenweaverDebug.prototype.apiError = function(arg)
{
if(!this.sync)
{
getURL("FSCommand:sw_etrace",arg);
}
else
{
this.syncTrace("error",arg);
}
};
ScreenweaverDebug.prototype.showWindow = function()
{
fscommand("sw_showDebugWindow");
};
ScreenweaverDebug.prototype.hideWindow = function()
{
fscommand("sw_hideDebugWindow");
};
ScreenweaverDebug.prototype.toggleVisibility = function()
{
fscommand("sw_toggleVisibilityDebugWindow");
};
ScreenweaverDebug.prototype.traceObject = function(obj)
{
var swTraceObject = new ScreenweaverTraceObject(obj);
delete swTraceObject;
};
_global.ScreenweaverTraceObject = function()
{
this.init.apply(this,arguments);
};
ScreenweaverTraceObject.prototype.init = function(obj)
{
this.parse.us = this;
var output = this.parse(obj);
swDebug.trace(output);
};
ScreenweaverTraceObject.prototype.indent = function(i)
{
var output = "";
var j = 0;
while(j < i)
{
output += "\t";
j++;
}
return output;
};
ScreenweaverTraceObject.prototype.parse = function(obj, i, name)
{
var output = "";
var us = arguments.callee.us;
if(i == undefined)
{
i == 0;
}
output += us.indent(i);
if(obj instanceof Array)
{
output += "[\n";
var j = 0;
while(j < obj.length)
{
output += arguments.callee(obj[j],i + 1,j);
j++;
}
output += us.indent(i);
output += "]\n";
}
else if(obj instanceof Object)
{
output += "{\n";
for(member in obj)
{
output += arguments.callee(obj[member],i + 1,member);
}
output += us.indent(i);
output += "}\n";
}
else
{
output += name + ": ";
if(type eq "string")
{
output += "\"";
}
output += obj;
if(type eq "string")
{
output += "\"";
}
output += "\n";
}
return output;
};